/*
 * Copyright (c) 2008-2013 Haulmont. All rights reserved.
 * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
 */

package com.haulmont.asu.entity;

import com.haulmont.chile.core.annotations.Composition;
import com.haulmont.chile.core.annotations.NamePattern;
import com.haulmont.cuba.core.entity.StandardEntity;

import javax.persistence.*;
import java.util.List;

/**
 * Author: Sergey42
 * Date: 01.12.13 17:12
 */
@Table(name = "EXT_COMMISSION_MEMBER_BLANK")
@Entity(name = "ext$CommissionMemberBlank")
@NamePattern("%s|number")
public class CommissionMemberBlank extends StandardEntity {

    private static final long serialVersionUID = 7487535329073949652L;

    @Column(name = "BLANK_NUMBER", length = 10)
    protected String number;

    @ManyToOne
    @JoinColumn(name = "COMMISSION_MEMBER_ID")
    protected CommissionMember commissionMember;

    @ManyToOne
    @JoinColumn(name = "DEFENSE_DAY_ID")
    protected DefenseDay defenseDay;

    @OneToMany(mappedBy = "blank", fetch = FetchType.EAGER)
    @Composition
    protected List<Mark> marks;

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public CommissionMember getCommissionMember() {
        return commissionMember;
    }

    public void setCommissionMember(CommissionMember commissionMember) {
        this.commissionMember = commissionMember;
    }

    public DefenseDay getDefenseDay() {
        return defenseDay;
    }

    public void setDefenseDay(DefenseDay defenseDay) {
        this.defenseDay = defenseDay;
    }

    public List<Mark> getMarks() {
        return marks;
    }

    public void setMarks(List<Mark> marks) {
        this.marks = marks;
    }
}
